package cn.sccl.dirms.security.service;

import cn.sccl.common.service.BaseManager;
import cn.sccl.dirms.security.model.Authority;
import cn.sccl.dirms.security.model.MenuAction;

import java.util.List;

/**
 * Created by 杨浩宇 on 2016-02-24.
 */
public interface AuthorityManager extends BaseManager<Authority> {
    /**
     * 根据用户ID查询具有的导航菜单
     *
     * @return
     */
    public List<Authority> findNavAuthoritesByUser(String userId);


    /**
     * 查询所有URL不为空的菜单
     *
     * @return
     */
    public List<Authority> findAllUrlNotNull();

    /**
     * 根据用户ID查询下属菜单
     *
     * @return
     */
    public List<Authority> findByUserId(String userId);

    /**
     * 根据用户ID查询功能菜单
     */
    public List<Authority> findByUser(String userId,String name);

    /**
     * 根据场景查询菜单
     * t_sec_authorities.sence字段
     *
     * @return
     */
    public List<Authority> findBySence(String userId ,String sence);

    /**
     * 查询子菜单
     * @param parentId
     * @return
     */
    public List<MenuAction> findChildren(String parentId);

    List<Authority> findAll();


    Authority findSingleByAuthorityName(String name);
}